package com.eyeem.recyclerviewtools.sample.utils.glide;

import android.content.Context;

import com.bumptech.glide.Glide;
import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.load.DecodeFormat;
import com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool;
import com.bumptech.glide.load.engine.cache.InternalCacheDiskCacheFactory;
import com.bumptech.glide.load.engine.cache.LruResourceCache;
import com.bumptech.glide.module.GlideModule;

/***
 * <meta-data
 * android:name="com.ruanko.jiaxiaotong.tv.parent.util.glide.GlideConfiguration"
 * android:value="GlideModule" />
 * <p>
 * 项目名称：
 * 类名称：
 * 类描述：
 * 创建人：
 * 创建时间：
 * 修改人：
 * 修改时间：
 * 修改备注：
 *
 * @version V1.0
 */
public class GlideConfiguration implements GlideModule {

    @Override
    public void applyOptions(Context context, GlideBuilder builder) {
        // Apply options to the builder here.
        builder.setDiskCache(new InternalCacheDiskCacheFactory(context, 10 * 1024));
        builder.setMemoryCache(new LruResourceCache(10 * 1024));
        builder.setBitmapPool(new LruBitmapPool(10 * 1024));
        builder.setDecodeFormat(DecodeFormat.PREFER_RGB_565);
    }

    @Override
    public void registerComponents(Context context, Glide glide) {
        // register ModelLoaders here.
    }
}